import request from '@/config/axios'

export interface BannerVO {
  id: number
  status: byte
  url: string
  sort: number
  pic: string
  slogan: string
}

// 查询轮播图管理列表
export const getBannerPage = async (params) => {
  return await request.get({ url: `/cms/banner/page`, params })
}

// 查询轮播图管理详情
export const getBanner = async (id: number) => {
  return await request.get({ url: `/cms/banner/get?id=` + id })
}

// 新增轮播图管理
export const createBanner = async (data: BannerVO) => {
  return await request.post({ url: `/cms/banner/create`, data })
}

// 修改轮播图管理
export const updateBanner = async (data: BannerVO) => {
  return await request.put({ url: `/cms/banner/update`, data })
}

// 删除轮播图管理
export const deleteBanner = async (id: number) => {
  return await request.delete({ url: `/cms/banner/delete?id=` + id })
}

// 导出轮播图管理 Excel
export const exportBanner = async (params) => {
  return await request.download({ url: `/cms/banner/export-excel`, params })
}
